<?php

namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;

class TaskRequest extends FormRequest
{

    /**
     *
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Determine if the user is authorized to make this request.
     * @return array
     */
    public function rules()
    {
        $rules = [
            'remark' => 'required',
            'date' => 'required',
            'body'  => 'required',
            'type'  => 'required',
            'mold' => 'required'
        ];
        return $rules;
    }

    /**
     * @return array
     */
    public function messages()
    {
        return [
            'remark.required' => '备注必填',
            'date.required' => '时间必填',
            'body.required' => '内容必填',
            'type.required' => '模块必填',
            'mold.required' => '类型必填'
        ];
    }
}
